home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / acpi / panapower.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2008-10-14  |  344b  |  18 lines

  1. #!/bin/sh
  2.  
  3. test -f /usr/share/acpi-support/key-constants || exit 0
  4.  
  5. . /usr/share/acpi-support/power-funcs
  6.  
  7. grep -q off-line /proc/acpi/ac_adapter/*/state
  8.  
  9. if [ $? = 0 ]
  10.         then
  11.     INTERFACE="dc_brightness"
  12. else
  13.     INTERFACE="ac_brightness"
  14. fi
  15.  
  16. BRIGHTNESS=$(( `cat /proc/acpi/pcc/$INTERFACE` + 0 ))
  17. echo $BRIGHTNESS > /proc/acpi/pcc/$INTERFACE
  18.